package com.value.vo;

import java.util.List;


public class Page extends ValueVO {
	private String event;//分页目标
	private Integer optionType;//分页目标操作类型
	/**
	 * 默认每页记录数
	 */
	public static int DEFAULT_PAGE_SIZE= 15;
	/**
	 * 总共多少条记录
	 */
	private Long count = 0L;
	/**
	 * 当前页开始位置
	 */
	private int start = 0;
	/**
	 * 当前页最后位置
	 */
	private int end = 0;
	/**
	 * 总页数
	 */
	private int totalPages = 0;
	/**
	 * 当前页码
	 */
	private int currentPage = 1;
	/**
	 * 每页记录数
	 */
	private int pageSize = DEFAULT_PAGE_SIZE;
	
	private List<?> queryList;
	
	public Long getCount() {
		return count;
	}
	public void setCount(Long count) {
		this.count = count;
		if(this.count == 0)
			this.totalPages = 1;
		else if (this.count % pageSize == 0) {
			this.totalPages = (int)(this.count / pageSize);
		} else {
			this.totalPages = (int)(this.count / pageSize + 1);
		}
	}
	public int getStart() {
		return start;
	}
	public void setStart(int start) {
		this.start = start;
	}
	public int getEnd() {
		return end;
	}
	public void setEnd(int end) {
		this.end = end;
	}
	public int getTotalPages() {
		return totalPages;
	}
	public void setTotalPages(int totalPages) {
		this.totalPages = totalPages;
	}
	public int getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public List<?> getQueryList() {
		return queryList;
	}
	public void setQueryList(List<?> queryList) {
		this.queryList = queryList;
	}
	public String getEvent() {
		return event;
	}
	public void setEvent(String event) {
		this.event = event;
	}
	public Integer getOptionType() {
		return optionType;
	}
	public void setOptionType(Integer optionType) {
		this.optionType = optionType;
	}
}
